#INCLUDE once <memcopy.bas>
#INCLUDE once <attr.bas>
    
SUB PrintChar(x AS UBYTE, y AS UBYTE, ind AS UBYTE, initercio AS INTEGER, offset AS BYTE)
DIM i AS UBYTE
 FOR i=0 TO 7
    MemCopy(@spaceFnt(ind-32,i)+offset,initercio+(32*x)+y+256*i,1)     
 next  i
END SUB

SUB PrintCharClear(x AS UBYTE, y AS UBYTE, ind AS UBYTE, inioffset AS BYTE, finoffset AS BYTE)
DIM i AS UBYTE
 FOR i=inioffset TO finoffset
    MemCopy(@spaceFnt(ind-32,i),20480+(32*x)+y+256*i,1)     
 next  i
END SUB
    
SUB muthur(tipo AS UBYTE, pausa AS BYTE, ind AS UInteger)
DIM i,p AS UBYTE
    IF tipo = 0 THEN     
          
      paint(0,bP-2,2,2,7)     
      putCharsOverMode(0,bP-2,ANCHO,2,0,@Matt_parado_der(0,16))     
      putCharsOverMode(0,bP-2,1,2,0,@Matt_parado_der(0,0))     
      paint(1,bP-1,1,1,57)     
    ELSEIF tipo = 1     
      paint(0,bP-2,2,2,7)     
      putCharsOverMode(0,bP-2,ANCHO,2,0,@Matt_parado_izq(0,16))    
      putCharsOverMode(0,bP-2,1,2,0,@Matt_parado_izq(0,0))    
      putChars(0,bP-1,1,1,@Matt_lars)
      paint(0,bP-1,1,1,59)     
    ELSEIF tipo=2      
       PrintChar(32-bP-2,0,35,20480,0): PrintChar(32-bP-2,1,47,20480,0): setAttr(bP-2,0,2):setAttr(bP-2,1,2)
       PrintChar(32-bP-1,0,62,20480,0): PrintChar(32-bP-1,1,124,20480,0): setAttr(bP-1,0,7):setAttr(bP-1,1,7)
    ELSE      
   END IF

    p=0
    FOR i=0 TO 29
       PrintChar(32-bP-2,p+2,peek(@txt+ind*30+i),20480,-3)     
       PrintCharClear(32-bP-2,p+2,45,0,3)     
       setAttr(bP-2,p+2,4)
       p=p+1
       IF pausa>0
         pause pausa: snd(50)
       end IF
    NEXT i
    p=0
    FOR i=0 TO 29
        PrintChar(32-bP-1,p+2,peek(@txt+ind*30+i),20480,5) 
        PrintCharClear(32-bP-1,p+2,46,4,7)     
        setAttr(bP-1,p+2,5)
       p=p+1
      IF pausa>0
         pause pausa: snd(50)
       end IF
    NEXT i
END SUB

SUB muthurClear(pausa AS BYTE)
    limpiaPerso()     
    muthur(5,pausa,0)     
END SUB

SUB limpiaPerso()
DIM i AS UBYTE
    
   FOR i=0 TO 1
       PrintChar(32-bP-2,i,45,20480,0)     
       setAttr(bP-2,i,4)
       PrintChar(32-bP-1,i,46,20480,0)     
       setAttr(bP-1,i,5)
    NEXT i
END SUB



